#!/bin/sh
if [ -n "$1" ]
then
	FSE_HOME=$1
else
	##没有指定安装路径时，指定默认的路径
	FSE_HOME="/usr/local/feature_se"
fi

FSE_HOME_LIB="$FSE_HOME/bin"
##目录不存在则退出
if [[ ! -d $FSE_HOME_LIB ]]
then
	echo  "not exist dir: $FSE_HOME_LIB"
	exit 0
fi
echo "uninstall from $FSE_HOME.............................."
# 删除安装目录
rm -frv  $FSE_HOME
## 删除conf
rm -fv /etc/ld.so.conf.d/feature_se_lib.conf
/sbin/ldconfig
##更新profile 
reg_path=`echo $FSE_HOME_LIB|sed -r 's/([\/\.])/\\\\\1/g'`
echo delete the line if exist:
echo \"export PATH=$FSE_HOME_LIB:\$PATH\"
sed -i_bak -r "/^\s*export\s*PATH=$reg_path:\\\$PATH/d" /etc/profile 		
echo "uninstall finished"

